package com.example.bysj_sb.domain;

import com.example.bysj_sb.domain.authority.Actor;
import com.example.bysj_sb.domain.authority.Role;
import lombok.*;

import java.io.Serializable;
import java.time.LocalDateTime;

@ToString
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class User implements Comparable<User>, Serializable {
	private Integer id;
	private String username;
	private String password;
	private LocalDateTime loginTime;
	private Actor actor;
	private Role role;

	public User(String username, String password, LocalDateTime loginTime, Actor actor) {
		this.username = username;
		this.password = password;
		this.loginTime = loginTime;
		this.actor = actor;
	}

	public User(Integer id, String username, String password) {
		this.id = id;
		this.username = username;
		this.password = password;
	}

	public User(Integer id, String username, String password, LocalDateTime o) {
		this(id, username, password);
		this.loginTime = o;

	}

	@Override
	public int compareTo(User o) {
		// TODO Auto-generated method stub
		return this.id - o.id;
	}

}
